home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / info / lispref.info-3.z / lispref.info-3
Encoding:
GNU Info File  |  1998-05-21  |  50.8 KB  |  1,244 lines

  1. This is Info file ../../info/lispref.info, produced by Makeinfo version
  2. 1.68 from the input file lispref.texi.
  3.  
  4.    Edition History:
  5.  
  6.    GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU
  7. Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid
  8. Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994
  9. XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995
  10. GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp
  11. Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp
  12. Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp
  13. Reference Manual (for 19.15 and 20.1, 20.2) v3.2, April, May 1997
  14.  
  15.    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software
  16. Foundation, Inc.  Copyright (C) 1994, 1995 Sun Microsystems, Inc.
  17. Copyright (C) 1995, 1996 Ben Wing.
  18.  
  19.    Permission is granted to make and distribute verbatim copies of this
  20. manual provided the copyright notice and this permission notice are
  21. preserved on all copies.
  22.  
  23.    Permission is granted to copy and distribute modified versions of
  24. this manual under the conditions for verbatim copying, provided that the
  25. entire resulting derived work is distributed under the terms of a
  26. permission notice identical to this one.
  27.  
  28.    Permission is granted to copy and distribute translations of this
  29. manual into another language, under the above conditions for modified
  30. versions, except that this permission notice may be stated in a
  31. translation approved by the Foundation.
  32.  
  33.    Permission is granted to copy and distribute modified versions of
  34. this manual under the conditions for verbatim copying, provided also
  35. that the section entitled "GNU General Public License" is included
  36. exactly as in the original, and provided that the entire resulting
  37. derived work is distributed under the terms of a permission notice
  38. identical to this one.
  39.  
  40.    Permission is granted to copy and distribute translations of this
  41. manual into another language, under the above conditions for modified
  42. versions, except that the section entitled "GNU General Public License"
  43. may be included in a translation approved by the Free Software
  44. Foundation instead of in the original English.
  45.  
  46. 
  47. File: lispref.info,  Node: Character Type,  Next: Symbol Type,  Prev: Floating Point Type,  Up: Programming Types
  48.  
  49. Character Type
  50. --------------
  51.  
  52.    In XEmacs version 19, and in all versions of FSF GNU Emacs, a
  53. "character" in XEmacs Lisp is nothing more than an integer.  This is
  54. yet another holdover from XEmacs Lisp's derivation from vintage-1980
  55. Lisps; modern versions of Lisp consider this equivalence a bad idea,
  56. and have separate character types.  In XEmacs version 20, the modern
  57. convention is followed, and characters are their own primitive types.
  58. (This change was necessary in order for MULE, i.e. Asian-language,
  59. support to be correctly implemented.)
  60.  
  61.    Even in XEmacs version 20, remnants of the equivalence between
  62. characters and integers still exist; this is termed the "char-int
  63. confoundance disease".  In particular, many functions such as `eq',
  64. `equal', and `memq' have equivalent functions (`old-eq', `old-equal',
  65. `old-memq', etc.) that pretend like characters are integers are the
  66. same.  Byte code compiled under any version 19 Emacs will have all such
  67. functions mapped to their `old-' equivalents when the byte code is read
  68. into XEmacs 20.  This is to preserve compatibility - Emacs 19 converts
  69. all constant characters to the equivalent integer during
  70. byte-compilation, and thus there is no other way to preserve byte-code
  71. compatibility even if the code has specifically been written with the
  72. distinction between characters and integers in mind.
  73.  
  74.    Every character has an equivalent integer, called the "character
  75. code".  For example, the character `A' is represented as the
  76. integer 65, following the standard ASCII representation of characters.
  77. If XEmacs was not compiled with MULE support, the range of this integer
  78. will always be 0 to 255 - eight bits, or one byte. (Integers outside
  79. this range are accepted but silently truncated; however, you should
  80. most decidedly *not* rely on this, because it will not work under
  81. XEmacs with MULE support.)  When MULE support is present, the range of
  82. character codes is much larger. (Currently, 19 bits are used.)
  83.  
  84.    FSF GNU Emacs uses kludgy character codes above 255 to represent
  85. keyboard input of ASCII characters in combination with certain
  86. modifiers.  XEmacs does not use this (a more general mechanism is used
  87. that does not distinguish between ASCII keys and other keys), so you
  88. will never find character codes above 255 in a non-MULE XEmacs.
  89.  
  90.    Individual characters are not often used in programs.  It is far more
  91. common to work with *strings*, which are sequences composed of
  92. characters.  *Note String Type::.
  93.  
  94.    The read syntax for characters begins with a question mark, followed
  95. by the character (if it's printable) or some symbolic representation of
  96. it.  In XEmacs 20, where characters are their own type, this is also the
  97. print representation.  In XEmacs 19, however, where characters are
  98. really integers, the printed representation of a character is a decimal
  99. number.  This is also a possible read syntax for a character, but
  100. writing characters that way in Lisp programs is a very bad idea.  You
  101. should *always* use the special read syntax formats that XEmacs Lisp
  102. provides for characters.
  103.  
  104.    The usual read syntax for alphanumeric characters is a question mark
  105. followed by the character; thus, `?A' for the character `A', `?B' for
  106. the character `B', and `?a' for the character `a'.
  107.  
  108.    For example:
  109.  
  110.      ;; Under XEmacs 20:
  111.      ?Q => ?Q    ?q => ?q
  112.      (char-int ?Q) => 81
  113.      ;; Under XEmacs 19:
  114.      ?Q => 81     ?q => 113
  115.  
  116.    You can use the same syntax for punctuation characters, but it is
  117. often a good idea to add a `\' so that the Emacs commands for editing
  118. Lisp code don't get confused.  For example, `?\ ' is the way to write
  119. the space character.  If the character is `\', you *must* use a second
  120. `\' to quote it: `?\\'.  XEmacs 20 always prints punctuation characters
  121. with a `\' in front of them, to avoid confusion.
  122.  
  123.    You can express the characters Control-g, backspace, tab, newline,
  124. vertical tab, formfeed, return, and escape as `?\a', `?\b', `?\t',
  125. `?\n', `?\v', `?\f', `?\r', `?\e', respectively.  Their character codes
  126. are 7, 8, 9, 10, 11, 12, 13, and 27 in decimal.  Thus,
  127.  
  128.      ;; Under XEmacs 20:
  129.      ?\a => ?\^G              ; `C-g'
  130.      (char-int ?\a) => 7
  131.      ?\b => ?\^H              ; backspace, <BS>, `C-h'
  132.      (char-int ?\b) => 8
  133.      ?\t => ?\t               ; tab, <TAB>, `C-i'
  134.      (char-int ?\t) => 9
  135.      ?\n => ?\n               ; newline, <LFD>, `C-j'
  136.      ?\v => ?\^K              ; vertical tab, `C-k'
  137.      ?\f => ?\^L              ; formfeed character, `C-l'
  138.      ?\r => ?\r               ; carriage return, <RET>, `C-m'
  139.      ?\e => ?\^[              ; escape character, <ESC>, `C-['
  140.      ?\\ => ?\\               ; backslash character, `\'
  141.      ;; Under XEmacs 19:
  142.      ?\a => 7                 ; `C-g'
  143.      ?\b => 8                 ; backspace, <BS>, `C-h'
  144.      ?\t => 9                 ; tab, <TAB>, `C-i'
  145.      ?\n => 10                ; newline, <LFD>, `C-j'
  146.      ?\v => 11                ; vertical tab, `C-k'
  147.      ?\f => 12                ; formfeed character, `C-l'
  148.      ?\r => 13                ; carriage return, <RET>, `C-m'
  149.      ?\e => 27                ; escape character, <ESC>, `C-['
  150.      ?\\ => 92                ; backslash character, `\'
  151.  
  152.    These sequences which start with backslash are also known as "escape
  153. sequences", because backslash plays the role of an escape character;
  154. this usage has nothing to do with the character <ESC>.
  155.  
  156.    Control characters may be represented using yet another read syntax.
  157. This consists of a question mark followed by a backslash, caret, and the
  158. corresponding non-control character, in either upper or lower case.  For
  159. example, both `?\^I' and `?\^i' are valid read syntax for the character
  160. `C-i', the character whose value is 9.
  161.  
  162.    Instead of the `^', you can use `C-'; thus, `?\C-i' is equivalent to
  163. `?\^I' and to `?\^i':
  164.  
  165.      ;; Under XEmacs 20:
  166.      ?\^I => ?\t   ?\C-I => ?\t
  167.      (char-int ?\^I) => 9
  168.      ;; Under XEmacs 19:
  169.      ?\^I => 9     ?\C-I => 9
  170.  
  171.    There is also a character read syntax beginning with `\M-'.  This
  172. sets the high bit of the character code (same as adding 128 to the
  173. character code).  For example, `?\M-A' stands for the character with
  174. character code 193, or 128 plus 65.  You should *not* use this syntax
  175. in your programs.  It is a holdover of yet another confoundance disease
  176. from earlier Emacsen. (This was used to represent keyboard input with
  177. the <META> key set, thus the `M'; however, it conflicts with the
  178. legitimate ISO-8859-1 interpretation of the character code.  For
  179. example, character code 193 is a lowercase `a' with an acute accent, in
  180. ISO-8859-1.)
  181.  
  182.    Finally, the most general read syntax consists of a question mark
  183. followed by a backslash and the character code in octal (up to three
  184. octal digits); thus, `?\101' for the character `A', `?\001' for the
  185. character `C-a', and `?\002' for the character `C-b'.  Although this
  186. syntax can represent any ASCII character, it is preferred only when the
  187. precise octal value is more important than the ASCII representation.
  188.  
  189.      ;; Under XEmacs 20:
  190.      ?\012 => ?\n        ?\n => ?\n        ?\C-j => ?\n
  191.      ?\101 => ?A         ?A => ?A
  192.      ;; Under XEmacs 19:
  193.      ?\012 => 10         ?\n => 10         ?\C-j => 10
  194.      ?\101 => 65         ?A => 65
  195.  
  196.    A backslash is allowed, and harmless, preceding any character without
  197. a special escape meaning; thus, `?\+' is equivalent to `?+'.  There is
  198. no reason to add a backslash before most characters.  However, you
  199. should add a backslash before any of the characters `()\|;'`"#.,' to
  200. avoid confusing the Emacs commands for editing Lisp code.  Also add a
  201. backslash before whitespace characters such as space, tab, newline and
  202. formfeed.  However, it is cleaner to use one of the easily readable
  203. escape sequences, such as `\t', instead of an actual whitespace
  204. character such as a tab.
  205.  
  206. 
  207. File: lispref.info,  Node: Symbol Type,  Next: Sequence Type,  Prev: Character Type,  Up: Programming Types
  208.  
  209. Symbol Type
  210. -----------
  211.  
  212.    A "symbol" in XEmacs Lisp is an object with a name.  The symbol name
  213. serves as the printed representation of the symbol.  In ordinary use,
  214. the name is unique--no two symbols have the same name.
  215.  
  216.    A symbol can serve as a variable, as a function name, or to hold a
  217. property list.  Or it may serve only to be distinct from all other Lisp
  218. objects, so that its presence in a data structure may be recognized
  219. reliably.  In a given context, usually only one of these uses is
  220. intended.  But you can use one symbol in all of these ways,
  221. independently.
  222.  
  223.    A symbol name can contain any characters whatever.  Most symbol names
  224. are written with letters, digits, and the punctuation characters
  225. `-+=*/'.  Such names require no special punctuation; the characters of
  226. the name suffice as long as the name does not look like a number.  (If
  227. it does, write a `\' at the beginning of the name to force
  228. interpretation as a symbol.)  The characters `_~!@$%^&:<>{}' are less
  229. often used but also require no special punctuation.  Any other
  230. characters may be included in a symbol's name by escaping them with a
  231. backslash.  In contrast to its use in strings, however, a backslash in
  232. the name of a symbol simply quotes the single character that follows the
  233. backslash.  For example, in a string, `\t' represents a tab character;
  234. in the name of a symbol, however, `\t' merely quotes the letter `t'.
  235. To have a symbol with a tab character in its name, you must actually
  236. use a tab (preceded with a backslash).  But it's rare to do such a
  237. thing.
  238.  
  239.      Common Lisp note: In Common Lisp, lower case letters are always
  240.      "folded" to upper case, unless they are explicitly escaped.  In
  241.      Emacs Lisp, upper case and lower case letters are distinct.
  242.  
  243.    Here are several examples of symbol names.  Note that the `+' in the
  244. fifth example is escaped to prevent it from being read as a number.
  245. This is not necessary in the sixth example because the rest of the name
  246. makes it invalid as a number.
  247.  
  248.      foo                 ; A symbol named `foo'.
  249.      FOO                 ; A symbol named `FOO', different from `foo'.
  250.      char-to-string      ; A symbol named `char-to-string'.
  251.      1+                  ; A symbol named `1+'
  252.                          ;   (not `+1', which is an integer).
  253.      \+1                 ; A symbol named `+1'
  254.                          ;   (not a very readable name).
  255.      \(*\ 1\ 2\)         ; A symbol named `(* 1 2)' (a worse name).
  256.      +-*/_~!@$%^&=:<>{}  ; A symbol named `+-*/_~!@$%^&=:<>{}'.
  257.                          ;   These characters need not be escaped.
  258.  
  259. 
  260. File: lispref.info,  Node: Sequence Type,  Next: Cons Cell Type,  Prev: Symbol Type,  Up: Programming Types
  261.  
  262. Sequence Types
  263. --------------
  264.  
  265.    A "sequence" is a Lisp object that represents an ordered set of
  266. elements.  There are two kinds of sequence in XEmacs Lisp, lists and
  267. arrays.  Thus, an object of type list or of type array is also
  268. considered a sequence.
  269.  
  270.    Arrays are further subdivided into strings, vectors, and bit vectors.
  271. Vectors can hold elements of any type, but string elements must be
  272. characters, and bit vector elements must be either 0 or 1.  However, the
  273. characters in a string can have extents (*note Extents::.) and text
  274. properties (*note Text Properties::.) like characters in a buffer;
  275. vectors do not support extents or text properties even when their
  276. elements happen to be characters.
  277.  
  278.    Lists, strings, vectors, and bit vectors are different, but they have
  279. important similarities.  For example, all have a length L, and all have
  280. elements which can be indexed from zero to L minus one.  Also, several
  281. functions, called sequence functions, accept any kind of sequence.  For
  282. example, the function `elt' can be used to extract an element of a
  283. sequence, given its index.  *Note Sequences Arrays Vectors::.
  284.  
  285.    It is impossible to read the same sequence twice, since sequences are
  286. always created anew upon reading.  If you read the read syntax for a
  287. sequence twice, you get two sequences with equal contents.  There is one
  288. exception: the empty list `()' always stands for the same object, `nil'.
  289.  
  290. 
  291. File: lispref.info,  Node: Cons Cell Type,  Next: Array Type,  Prev: Sequence Type,  Up: Programming Types
  292.  
  293. Cons Cell and List Types
  294. ------------------------
  295.  
  296.    A "cons cell" is an object comprising two pointers named the CAR and
  297. the CDR.  Each of them can point to any Lisp object.
  298.  
  299.    A "list" is a series of cons cells, linked together so that the CDR
  300. of each cons cell points either to another cons cell or to the empty
  301. list.  *Note Lists::, for functions that work on lists.  Because most
  302. cons cells are used as part of lists, the phrase "list structure" has
  303. come to refer to any structure made out of cons cells.
  304.  
  305.    The names CAR and CDR have only historical meaning now.  The
  306. original Lisp implementation ran on an IBM 704 computer which divided
  307. words into two parts, called the "address" part and the "decrement";
  308. CAR was an instruction to extract the contents of the address part of a
  309. register, and CDR an instruction to extract the contents of the
  310. decrement.  By contrast, "cons cells" are named for the function `cons'
  311. that creates them, which in turn is named for its purpose, the
  312. construction of cells.
  313.  
  314.    Because cons cells are so central to Lisp, we also have a word for
  315. "an object which is not a cons cell".  These objects are called "atoms".
  316.  
  317.    The read syntax and printed representation for lists are identical,
  318. and consist of a left parenthesis, an arbitrary number of elements, and
  319. a right parenthesis.
  320.  
  321.    Upon reading, each object inside the parentheses becomes an element
  322. of the list.  That is, a cons cell is made for each element.  The CAR
  323. of the cons cell points to the element, and its CDR points to the next
  324. cons cell of the list, which holds the next element in the list.  The
  325. CDR of the last cons cell is set to point to `nil'.
  326.  
  327.    A list can be illustrated by a diagram in which the cons cells are
  328. shown as pairs of boxes.  (The Lisp reader cannot read such an
  329. illustration; unlike the textual notation, which can be understood by
  330. both humans and computers, the box illustrations can be understood only
  331. by humans.)  The following represents the three-element list `(rose
  332. violet buttercup)':
  333.  
  334.          ___ ___      ___ ___      ___ ___
  335.         |___|___|--> |___|___|--> |___|___|--> nil
  336.           |            |            |
  337.           |            |            |
  338.            --> rose     --> violet   --> buttercup
  339.  
  340.    In this diagram, each box represents a slot that can refer to any
  341. Lisp object.  Each pair of boxes represents a cons cell.  Each arrow is
  342. a reference to a Lisp object, either an atom or another cons cell.
  343.  
  344.    In this example, the first box, the CAR of the first cons cell,
  345. refers to or "contains" `rose' (a symbol).  The second box, the CDR of
  346. the first cons cell, refers to the next pair of boxes, the second cons
  347. cell.  The CAR of the second cons cell refers to `violet' and the CDR
  348. refers to the third cons cell.  The CDR of the third (and last) cons
  349. cell refers to `nil'.
  350.  
  351.    Here is another diagram of the same list, `(rose violet buttercup)',
  352. sketched in a different manner:
  353.  
  354.      ---------------       ----------------       -------------------
  355.      | car   | cdr   |     | car    | cdr   |     | car       | cdr   |
  356.      | rose  |   o-------->| violet |   o-------->| buttercup |  nil  |
  357.      |       |       |     |        |       |     |           |       |
  358.       ---------------       ----------------       -------------------
  359.  
  360.    A list with no elements in it is the "empty list"; it is identical
  361. to the symbol `nil'.  In other words, `nil' is both a symbol and a list.
  362.  
  363.    Here are examples of lists written in Lisp syntax:
  364.  
  365.      (A 2 "A")            ; A list of three elements.
  366.      ()                   ; A list of no elements (the empty list).
  367.      nil                  ; A list of no elements (the empty list).
  368.      ("A ()")             ; A list of one element: the string `"A ()"'.
  369.      (A ())               ; A list of two elements: `A' and the empty list.
  370.      (A nil)              ; Equivalent to the previous.
  371.      ((A B C))            ; A list of one element
  372.                           ;   (which is a list of three elements).
  373.  
  374.    Here is the list `(A ())', or equivalently `(A nil)', depicted with
  375. boxes and arrows:
  376.  
  377.          ___ ___      ___ ___
  378.         |___|___|--> |___|___|--> nil
  379.           |            |
  380.           |            |
  381.            --> A        --> nil
  382.  
  383. * Menu:
  384.  
  385. * Dotted Pair Notation::        An alternative syntax for lists.
  386. * Association List Type::       A specially constructed list.
  387.  
  388. 
  389. File: lispref.info,  Node: Dotted Pair Notation,  Next: Association List Type,  Up: Cons Cell Type
  390.  
  391. Dotted Pair Notation
  392. ....................
  393.  
  394.    "Dotted pair notation" is an alternative syntax for cons cells that
  395. represents the CAR and CDR explicitly.  In this syntax, `(A . B)'
  396. stands for a cons cell whose CAR is the object A, and whose CDR is the
  397. object B.  Dotted pair notation is therefore more general than list
  398. syntax.  In the dotted pair notation, the list `(1 2 3)' is written as
  399. `(1 .  (2 . (3 . nil)))'.  For `nil'-terminated lists, the two
  400. notations produce the same result, but list notation is usually clearer
  401. and more convenient when it is applicable.  When printing a list, the
  402. dotted pair notation is only used if the CDR of a cell is not a list.
  403.  
  404.    Here's how box notation can illustrate dotted pairs.  This example
  405. shows the pair `(rose . violet)':
  406.  
  407.          ___ ___
  408.         |___|___|--> violet
  409.           |
  410.           |
  411.            --> rose
  412.  
  413.    Dotted pair notation can be combined with list notation to represent
  414. a chain of cons cells with a non-`nil' final CDR.  For example, `(rose
  415. violet . buttercup)' is equivalent to `(rose . (violet . buttercup))'.
  416. The object looks like this:
  417.  
  418.          ___ ___      ___ ___
  419.         |___|___|--> |___|___|--> buttercup
  420.           |            |
  421.           |            |
  422.            --> rose     --> violet
  423.  
  424.    These diagrams make it evident why `(rose . violet . buttercup)' is
  425. invalid syntax; it would require a cons cell that has three parts
  426. rather than two.
  427.  
  428.    The list `(rose violet)' is equivalent to `(rose . (violet))' and
  429. looks like this:
  430.  
  431.          ___ ___      ___ ___
  432.         |___|___|--> |___|___|--> nil
  433.           |            |
  434.           |            |
  435.            --> rose     --> violet
  436.  
  437.    Similarly, the three-element list `(rose violet buttercup)' is
  438. equivalent to `(rose . (violet . (buttercup)))'.  It looks like this:
  439.  
  440.          ___ ___      ___ ___      ___ ___
  441.         |___|___|--> |___|___|--> |___|___|--> nil
  442.           |            |            |
  443.           |            |            |
  444.            --> rose     --> violet   --> buttercup
  445.  
  446. 
  447. File: lispref.info,  Node: Association List Type,  Prev: Dotted Pair Notation,  Up: Cons Cell Type
  448.  
  449. Association List Type
  450. .....................
  451.  
  452.    An "association list" or "alist" is a specially-constructed list
  453. whose elements are cons cells.  In each element, the CAR is considered
  454. a "key", and the CDR is considered an "associated value".  (In some
  455. cases, the associated value is stored in the CAR of the CDR.)
  456. Association lists are often used as stacks, since it is easy to add or
  457. remove associations at the front of the list.
  458.  
  459.    For example,
  460.  
  461.      (setq alist-of-colors
  462.            '((rose . red) (lily . white)  (buttercup . yellow)))
  463.  
  464. sets the variable `alist-of-colors' to an alist of three elements.  In
  465. the first element, `rose' is the key and `red' is the value.
  466.  
  467.    *Note Association Lists::, for a further explanation of alists and
  468. for functions that work on alists.
  469.  
  470. 
  471. File: lispref.info,  Node: Array Type,  Next: String Type,  Prev: Cons Cell Type,  Up: Programming Types
  472.  
  473. Array Type
  474. ----------
  475.  
  476.    An "array" is composed of an arbitrary number of slots for referring
  477. to other Lisp objects, arranged in a contiguous block of memory.
  478. Accessing any element of an array takes the same amount of time.  In
  479. contrast, accessing an element of a list requires time proportional to
  480. the position of the element in the list.  (Elements at the end of a
  481. list take longer to access than elements at the beginning of a list.)
  482.  
  483.    XEmacs defines three types of array, strings, vectors, and bit
  484. vectors.  A string is an array of characters, a vector is an array of
  485. arbitrary objects, and a bit vector is an array of 1's and 0's.  All are
  486. one-dimensional.  (Most other programming languages support
  487. multidimensional arrays, but they are not essential; you can get the
  488. same effect with an array of arrays.)  Each type of array has its own
  489. read syntax; see *Note String Type::, *Note Vector Type::, and *Note
  490. Bit Vector Type::.
  491.  
  492.    An array may have any length up to the largest integer; but once
  493. created, it has a fixed size.  The first element of an array has index
  494. zero, the second element has index 1, and so on.  This is called
  495. "zero-origin" indexing.  For example, an array of four elements has
  496. indices 0, 1, 2, and 3.
  497.  
  498.    The array type is contained in the sequence type and contains the
  499. string type, the vector type, and the bit vector type.
  500.  
  501. 
  502. File: lispref.info,  Node: String Type,  Next: Vector Type,  Prev: Array Type,  Up: Programming Types
  503.  
  504. String Type
  505. -----------
  506.  
  507.    A "string" is an array of characters.  Strings are used for many
  508. purposes in XEmacs, as can be expected in a text editor; for example, as
  509. the names of Lisp symbols, as messages for the user, and to represent
  510. text extracted from buffers.  Strings in Lisp are constants: evaluation
  511. of a string returns the same string.
  512.  
  513.    The read syntax for strings is a double-quote, an arbitrary number of
  514. characters, and another double-quote, `"like this"'.  The Lisp reader
  515. accepts the same formats for reading the characters of a string as it
  516. does for reading single characters (without the question mark that
  517. begins a character literal).  You can enter a nonprinting character such
  518. as tab or `C-a' using the convenient escape sequences, like this: `"\t,
  519. \C-a"'.  You can include a double-quote in a string by preceding it
  520. with a backslash; thus, `"\""' is a string containing just a single
  521. double-quote character.  (*Note Character Type::, for a description of
  522. the read syntax for characters.)
  523.  
  524.    The printed representation of a string consists of a double-quote,
  525. the characters it contains, and another double-quote.  However, you must
  526. escape any backslash or double-quote characters in the string with a
  527. backslash, like this: `"this \" is an embedded quote"'.
  528.  
  529.    The newline character is not special in the read syntax for strings;
  530. if you write a new line between the double-quotes, it becomes a
  531. character in the string.  But an escaped newline--one that is preceded
  532. by `\'--does not become part of the string; i.e., the Lisp reader
  533. ignores an escaped newline while reading a string.
  534.  
  535.      "It is useful to include newlines
  536.      in documentation strings,
  537.      but the newline is \
  538.      ignored if escaped."
  539.           => "It is useful to include newlines
  540.      in documentation strings,
  541.      but the newline is ignored if escaped."
  542.  
  543.    A string can hold extents and properties of the text it contains, in
  544. addition to the characters themselves.  This enables programs that copy
  545. text between strings and buffers to preserve the extents and properties
  546. with no special effort.  *Note Extents::; *Note Text Properties::.
  547.  
  548.    Note that FSF GNU Emacs has a special read and print syntax for
  549. strings with text properties, but XEmacs does not currently implement
  550. this.  It was judged better not to include this in XEmacs because it
  551. entails that `equal' return `nil' when passed a string with text
  552. properties and the equivalent string without text properties, which is
  553. often counter-intuitive.
  554.  
  555.    *Note Strings and Characters::, for functions that work on strings.
  556.  
  557. 
  558. File: lispref.info,  Node: Vector Type,  Next: Bit Vector Type,  Prev: String Type,  Up: Programming Types
  559.  
  560. Vector Type
  561. -----------
  562.  
  563.    A "vector" is a one-dimensional array of elements of any type.  It
  564. takes a constant amount of time to access any element of a vector.  (In
  565. a list, the access time of an element is proportional to the distance of
  566. the element from the beginning of the list.)
  567.  
  568.    The printed representation of a vector consists of a left square
  569. bracket, the elements, and a right square bracket.  This is also the
  570. read syntax.  Like numbers and strings, vectors are considered constants
  571. for evaluation.
  572.  
  573.      [1 "two" (three)]      ; A vector of three elements.
  574.           => [1 "two" (three)]
  575.  
  576.    *Note Vectors::, for functions that work with vectors.
  577.  
  578. 
  579. File: lispref.info,  Node: Bit Vector Type,  Next: Function Type,  Prev: Vector Type,  Up: Programming Types
  580.  
  581. Bit Vector Type
  582. ---------------
  583.  
  584.    A "bit vector" is a one-dimensional array of 1's and 0's.  It takes
  585. a constant amount of time to access any element of a bit vector, as for
  586. vectors.  Bit vectors have an extremely compact internal representation
  587. (one machine bit per element), which makes them ideal for keeping track
  588. of unordered sets, large collections of boolean values, etc.
  589.  
  590.    The printed representation of a bit vector consists of `#*' followed
  591. by the bits in the vector.  This is also the read syntax.  Like
  592. numbers, strings, and vectors, bit vectors are considered constants for
  593. evaluation.
  594.  
  595.      #*00101000      ; A bit vector of eight elements.
  596.           => #*00101000
  597.  
  598.    *Note Bit Vectors::, for functions that work with bit vectors.
  599.  
  600. 
  601. File: lispref.info,  Node: Function Type,  Next: Macro Type,  Prev: Bit Vector Type,  Up: Programming Types
  602.  
  603. Function Type
  604. -------------
  605.  
  606.    Just as functions in other programming languages are executable,
  607. "Lisp function" objects are pieces of executable code.  However,
  608. functions in Lisp are primarily Lisp objects, and only secondarily the
  609. text which represents them.  These Lisp objects are lambda expressions:
  610. lists whose first element is the symbol `lambda' (*note Lambda
  611. Expressions::.).
  612.  
  613.    In most programming languages, it is impossible to have a function
  614. without a name.  In Lisp, a function has no intrinsic name.  A lambda
  615. expression is also called an "anonymous function" (*note Anonymous
  616. Functions::.).  A named function in Lisp is actually a symbol with a
  617. valid function in its function cell (*note Defining Functions::.).
  618.  
  619.    Most of the time, functions are called when their names are written
  620. in Lisp expressions in Lisp programs.  However, you can construct or
  621. obtain a function object at run time and then call it with the primitive
  622. functions `funcall' and `apply'.  *Note Calling Functions::.
  623.  
  624. 
  625. File: lispref.info,  Node: Macro Type,  Next: Primitive Function Type,  Prev: Function Type,  Up: Programming Types
  626.  
  627. Macro Type
  628. ----------
  629.  
  630.    A "Lisp macro" is a user-defined construct that extends the Lisp
  631. language.  It is represented as an object much like a function, but with
  632. different parameter-passing semantics.  A Lisp macro has the form of a
  633. list whose first element is the symbol `macro' and whose CDR is a Lisp
  634. function object, including the `lambda' symbol.
  635.  
  636.    Lisp macro objects are usually defined with the built-in `defmacro'
  637. function, but any list that begins with `macro' is a macro as far as
  638. XEmacs is concerned.  *Note Macros::, for an explanation of how to
  639. write a macro.
  640.  
  641. 
  642. File: lispref.info,  Node: Primitive Function Type,  Next: Compiled-Function Type,  Prev: Macro Type,  Up: Programming Types
  643.  
  644. Primitive Function Type
  645. -----------------------
  646.  
  647.    A "primitive function" is a function callable from Lisp but written
  648. in the C programming language.  Primitive functions are also called
  649. "subrs" or "built-in functions".  (The word "subr" is derived from
  650. "subroutine".)  Most primitive functions evaluate all their arguments
  651. when they are called.  A primitive function that does not evaluate all
  652. its arguments is called a "special form" (*note Special Forms::.).
  653.  
  654.    It does not matter to the caller of a function whether the function
  655. is primitive.  However, this does matter if you try to substitute a
  656. function written in Lisp for a primitive of the same name.  The reason
  657. is that the primitive function may be called directly from C code.
  658. Calls to the redefined function from Lisp will use the new definition,
  659. but calls from C code may still use the built-in definition.
  660.  
  661.    The term "function" refers to all Emacs functions, whether written
  662. in Lisp or C.  *Note Function Type::, for information about the
  663. functions written in Lisp.
  664.  
  665.    Primitive functions have no read syntax and print in hash notation
  666. with the name of the subroutine.
  667.  
  668.      (symbol-function 'car)          ; Access the function cell
  669.                                      ;   of the symbol.
  670.           => #<subr car>
  671.      (subrp (symbol-function 'car))  ; Is this a primitive function?
  672.           => t                       ; Yes.
  673.  
  674. 
  675. File: lispref.info,  Node: Compiled-Function Type,  Next: Autoload Type,  Prev: Primitive Function Type,  Up: Programming Types
  676.  
  677. Compiled-Function Type
  678. ----------------------
  679.  
  680.    The byte compiler produces "compiled-function objects".  The
  681. evaluator handles this data type specially when it appears as a function
  682. to be called.  *Note Byte Compilation::, for information about the byte
  683. compiler.
  684.  
  685.    The printed representation for a compiled-function object is normally
  686. `#<compiled-function...>'.  If `print-readably' is true, however, it is
  687. `#[...]'.
  688.  
  689. 
  690. File: lispref.info,  Node: Autoload Type,  Next: Char Table Type,  Prev: Compiled-Function Type,  Up: Programming Types
  691.  
  692. Autoload Type
  693. -------------
  694.  
  695.    An "autoload object" is a list whose first element is the symbol
  696. `autoload'.  It is stored as the function definition of a symbol as a
  697. placeholder for the real definition; it says that the real definition
  698. is found in a file of Lisp code that should be loaded when necessary.
  699. The autoload object contains the name of the file, plus some other
  700. information about the real definition.
  701.  
  702.    After the file has been loaded, the symbol should have a new function
  703. definition that is not an autoload object.  The new definition is then
  704. called as if it had been there to begin with.  From the user's point of
  705. view, the function call works as expected, using the function definition
  706. in the loaded file.
  707.  
  708.    An autoload object is usually created with the function `autoload',
  709. which stores the object in the function cell of a symbol.  *Note
  710. Autoload::, for more details.
  711.  
  712. 
  713. File: lispref.info,  Node: Char Table Type,  Next: Hash Table Type,  Prev: Autoload Type,  Up: Programming Types
  714.  
  715. Char Table Type
  716. ---------------
  717.  
  718.    (not yet documented)
  719.  
  720. 
  721. File: lispref.info,  Node: Hash Table Type,  Next: Range Table Type,  Prev: Char Table Type,  Up: Programming Types
  722.  
  723. Hash Table Type
  724. ---------------
  725.  
  726.    A "hash table" is a table providing an arbitrary mapping from one
  727. Lisp object to another, using an internal indexing method called
  728. "hashing".  Hash tables are very fast (much more efficient that using
  729. an association list, when there are a large number of elements in the
  730. table).
  731.  
  732.    Hash tables have no read syntax.  They print in hash notation (The
  733. "hash" in "hash notation" has nothing to do with the "hash" in "hash
  734. table"), giving the number of elements, total space allocated for
  735. elements, and a unique number assigned at the time the hash table was
  736. created. (Hash tables automatically resize as necessary so there is no
  737. danger of running out of space for elements.)
  738.  
  739.      (make-hashtable 50)
  740.           => #<hashtable 0/71 0x313a>
  741.  
  742.    *Note Hash Tables::, for information on how to create and work with
  743. hash tables.
  744.  
  745. 
  746. File: lispref.info,  Node: Range Table Type,  Next: Weak List Type,  Prev: Hash Table Type,  Up: Programming Types
  747.  
  748. Range Table Type
  749. ----------------
  750.  
  751.    A "range table" is a table that maps from ranges of integers to
  752. arbitrary Lisp objects.  Range tables automatically combine overlapping
  753. ranges that map to the same Lisp object, and operations are provided
  754. for mapping over all of the ranges in a range table.
  755.  
  756.    Range tables have a special read syntax beginning with
  757. `#s(range-table' (this is an example of "structure" read syntax, which
  758. is also used for char tables and faces).
  759.  
  760.      (setq x (make-range-table))
  761.      (put-range-table 20 50 'foo x)
  762.      (put-range-table 100 200 "bar" x)
  763.      x
  764.           => #s(range-table data ((20 50) foo (100 200) "bar"))
  765.  
  766.    *Note Range Tables::, for information on how to create and work with
  767. range tables.
  768.  
  769. 
  770. File: lispref.info,  Node: Weak List Type,  Prev: Range Table Type,  Up: Programming Types
  771.  
  772. Weak List Type
  773. --------------
  774.  
  775.    (not yet documented)
  776.  
  777. 
  778. File: lispref.info,  Node: Editing Types,  Next: Window-System Types,  Prev: Programming Types,  Up: Lisp Data Types
  779.  
  780. Editing Types
  781. =============
  782.  
  783.    The types in the previous section are common to many Lisp dialects.
  784. XEmacs Lisp provides several additional data types for purposes
  785. connected with editing.
  786.  
  787. * Menu:
  788.  
  789. * Buffer Type::         The basic object of editing.
  790. * Marker Type::         A position in a buffer.
  791. * Extent Type::         A range in a buffer or string, maybe with properties.
  792. * Window Type::         Buffers are displayed in windows.
  793. * Frame Type::        Windows subdivide frames.
  794. * Device Type::         Devices group all frames on a display.
  795. * Console Type::        Consoles group all devices with the same keyboard.
  796. * Window Configuration Type::   Recording the way a frame is subdivided.
  797. * Event Type::          An interesting occurrence in the system.
  798. * Process Type::        A process running on the underlying OS.
  799. * Stream Type::         Receive or send characters.
  800. * Keymap Type::         What function a keystroke invokes.
  801. * Syntax Table Type::   What a character means.
  802. * Display Table Type::  How display tables are represented.
  803. * Database Type::       A connection to an external DBM or DB database.
  804. * Charset Type::        A character set (e.g. all Kanji characters),
  805.                           under XEmacs/MULE.
  806. * Coding System Type::  An object encapsulating a way of converting between
  807.                           different textual encodings, under XEmacs/MULE.
  808. * ToolTalk Message Type:: A message, in the ToolTalk IPC protocol.
  809. * ToolTalk Pattern Type:: A pattern, in the ToolTalk IPC protocol.
  810.  
  811. 
  812. File: lispref.info,  Node: Buffer Type,  Next: Marker Type,  Up: Editing Types
  813.  
  814. Buffer Type
  815. -----------
  816.  
  817.    A "buffer" is an object that holds text that can be edited (*note
  818. Buffers::.).  Most buffers hold the contents of a disk file (*note
  819. Files::.) so they can be edited, but some are used for other purposes.
  820. Most buffers are also meant to be seen by the user, and therefore
  821. displayed, at some time, in a window (*note Windows::.).  But a buffer
  822. need not be displayed in any window.
  823.  
  824.    The contents of a buffer are much like a string, but buffers are not
  825. used like strings in XEmacs Lisp, and the available operations are
  826. different.  For example, insertion of text into a buffer is very
  827. efficient, whereas "inserting" text into a string requires
  828. concatenating substrings, and the result is an entirely new string
  829. object.
  830.  
  831.    Each buffer has a designated position called "point" (*note
  832. Positions::.).  At any time, one buffer is the "current buffer".  Most
  833. editing commands act on the contents of the current buffer in the
  834. neighborhood of point.  Many of the standard Emacs functions manipulate
  835. or test the characters in the current buffer; a whole chapter in this
  836. manual is devoted to describing these functions (*note Text::.).
  837.  
  838.    Several other data structures are associated with each buffer:
  839.  
  840.    * a local syntax table (*note Syntax Tables::.);
  841.  
  842.    * a local keymap (*note Keymaps::.);
  843.  
  844.    * a local variable binding list (*note Buffer-Local Variables::.);
  845.  
  846.    * a list of extents (*note Extents::.);
  847.  
  848.    * and various other related properties.
  849.  
  850. The local keymap and variable list contain entries that individually
  851. override global bindings or values.  These are used to customize the
  852. behavior of programs in different buffers, without actually changing the
  853. programs.
  854.  
  855.    A buffer may be "indirect", which means it shares the text of
  856. another buffer.  *Note Indirect Buffers::.
  857.  
  858.    Buffers have no read syntax.  They print in hash notation, showing
  859. the buffer name.
  860.  
  861.      (current-buffer)
  862.           => #<buffer "objects.texi">
  863.  
  864. 
  865. File: lispref.info,  Node: Marker Type,  Next: Extent Type,  Prev: Buffer Type,  Up: Editing Types
  866.  
  867. Marker Type
  868. -----------
  869.  
  870.    A "marker" denotes a position in a specific buffer.  Markers
  871. therefore have two components: one for the buffer, and one for the
  872. position.  Changes in the buffer's text automatically relocate the
  873. position value as necessary to ensure that the marker always points
  874. between the same two characters in the buffer.
  875.  
  876.    Markers have no read syntax.  They print in hash notation, giving the
  877. current character position and the name of the buffer.
  878.  
  879.      (point-marker)
  880.           => #<marker at 50661 in objects.texi>
  881.  
  882.    *Note Markers::, for information on how to test, create, copy, and
  883. move markers.
  884.  
  885. 
  886. File: lispref.info,  Node: Extent Type,  Next: Window Type,  Prev: Marker Type,  Up: Editing Types
  887.  
  888. Extent Type
  889. -----------
  890.  
  891.    An "extent" specifies temporary alteration of the display appearance
  892. of a part of a buffer (or string).  It contains markers delimiting a
  893. range of the buffer, plus a property list (a list whose elements are
  894. alternating property names and values).  Extents are used to present
  895. parts of the buffer temporarily in a different display style.  They
  896. have no read syntax, and print in hash notation, giving the buffer name
  897. and range of positions.
  898.  
  899.    Extents can exist over strings as well as buffers; the primary use
  900. of this is to preserve extent and text property information as text is
  901. copied from one buffer to another or between different parts of a
  902. buffer.
  903.  
  904.    Extents have no read syntax.  They print in hash notation, giving the
  905. range of text they cover, the name of the buffer or string they are in,
  906. the address in core, and a summary of some of the properties attached to
  907. the extent.
  908.  
  909.      (extent-at (point))
  910.           => #<extent [51742, 51748) font-lock text-prop 0x90121e0 in buffer objects.texi>
  911.  
  912.    *Note Extents::, for how to create and use extents.
  913.  
  914.    Extents are used to implement text properties.  *Note Text
  915. Properties::.
  916.  
  917. 
  918. File: lispref.info,  Node: Window Type,  Next: Frame Type,  Prev: Extent Type,  Up: Editing Types
  919.  
  920. Window Type
  921. -----------
  922.  
  923.    A "window" describes the portion of the frame that XEmacs uses to
  924. display a buffer. (In standard window-system usage, a "window" is what
  925. XEmacs calls a "frame"; XEmacs confusingly uses the term "window" to
  926. refer to what is called a "pane" in standard window-system usage.)
  927. Every window has one associated buffer, whose contents appear in the
  928. window.  By contrast, a given buffer may appear in one window, no
  929. window, or several windows.
  930.  
  931.    Though many windows may exist simultaneously, at any time one window
  932. is designated the "selected window".  This is the window where the
  933. cursor is (usually) displayed when XEmacs is ready for a command.  The
  934. selected window usually displays the current buffer, but this is not
  935. necessarily the case.
  936.  
  937.    Windows are grouped on the screen into frames; each window belongs to
  938. one and only one frame.  *Note Frame Type::.
  939.  
  940.    Windows have no read syntax.  They print in hash notation, giving the
  941. name of the buffer being displayed and a unique number assigned at the
  942. time the window was created. (This number can be useful because the
  943. buffer displayed in any given window can change frequently.)
  944.  
  945.      (selected-window)
  946.           => #<window on "objects.texi" 0x266c>
  947.  
  948.    *Note Windows::, for a description of the functions that work on
  949. windows.
  950.  
  951. 
  952. File: lispref.info,  Node: Frame Type,  Next: Device Type,  Prev: Window Type,  Up: Editing Types
  953.  
  954. Frame Type
  955. ----------
  956.  
  957.    A FRAME is a rectangle on the screen (a "window" in standard
  958. window-system terminology) that contains one or more non-overlapping
  959. Emacs windows ("panes" in standard window-system terminology).  A frame
  960. initially contains a single main window (plus perhaps a minibuffer
  961. window) which you can subdivide vertically or horizontally into smaller
  962. windows.
  963.  
  964.    Frames have no read syntax.  They print in hash notation, giving the
  965. frame's type, name as used for resourcing, and a unique number assigned
  966. at the time the frame was created.
  967.  
  968.      (selected-frame)
  969.           => #<x-frame "emacs" 0x9db>
  970.  
  971.    *Note Frames::, for a description of the functions that work on
  972. frames.
  973.  
  974. 
  975. File: lispref.info,  Node: Device Type,  Next: Console Type,  Prev: Frame Type,  Up: Editing Types
  976.  
  977. Device Type
  978. -----------
  979.  
  980.    A "device" represents a single display on which frames exist.
  981. Normally, there is only one device object, but there may be more than
  982. one if XEmacs is being run on a multi-headed display (e.g. an X server
  983. with attached color and mono screens) or if XEmacs is simultaneously
  984. driving frames attached to different consoles, e.g.  an X display and a
  985. TTY connection.
  986.  
  987.    Devices do not have a read syntax.  They print in hash notation,
  988. giving the device's type, connection name, and a unique number assigned
  989. at the time the device was created.
  990.  
  991.      (selected-device)
  992.           => #<x-device on ":0.0" 0x5b9>
  993.  
  994.    *Note Consoles and Devices::, for a description of several functions
  995. related to devices.
  996.  
  997. 
  998. File: lispref.info,  Node: Console Type,  Next: Window Configuration Type,  Prev: Device Type,  Up: Editing Types
  999.  
  1000. Console Type
  1001. ------------
  1002.  
  1003.    A "console" represents a single keyboard to which devices (i.e.
  1004. displays on which frames exist) are connected.  Normally, there is only
  1005. one console object, but there may be more than one if XEmacs is
  1006. simultaneously driving frames attached to different X servers and/or
  1007. TTY connections. (XEmacs is capable of driving multiple X and TTY
  1008. connections at the same time, and provides a robust mechanism for
  1009. handling the differing display capabilities of such heterogeneous
  1010. environments.  A buffer with embedded glyphs and multiple fonts and
  1011. colors, for example, will display reasonably if it simultaneously
  1012. appears on a frame on a color X display, a frame on a mono X display,
  1013. and a frame on a TTY connection.)
  1014.  
  1015.    Consoles do not have a read syntax.  They print in hash notation,
  1016. giving the console's type, connection name, and a unique number assigned
  1017. at the time the console was created.
  1018.  
  1019.      (selected-console)
  1020.           => #<x-console on "localhost:0" 0x5b7>
  1021.  
  1022.    *Note Consoles and Devices::, for a description of several functions
  1023. related to consoles.
  1024.  
  1025. 
  1026. File: lispref.info,  Node: Window Configuration Type,  Next: Event Type,  Prev: Console Type,  Up: Editing Types
  1027.  
  1028. Window Configuration Type
  1029. -------------------------
  1030.  
  1031.    A "window configuration" stores information about the positions,
  1032. sizes, and contents of the windows in a frame, so you can recreate the
  1033. same arrangement of windows later.
  1034.  
  1035.    Window configurations do not have a read syntax.  They print in hash
  1036. notation, giving a unique number assigned at the time the window
  1037. configuration was created.
  1038.  
  1039.      (current-window-configuration)
  1040.           => #<window-configuration 0x2db4>
  1041.  
  1042.    *Note Window Configurations::, for a description of several functions
  1043. related to window configurations.
  1044.  
  1045. 
  1046. File: lispref.info,  Node: Event Type,  Next: Process Type,  Prev: Window Configuration Type,  Up: Editing Types
  1047.  
  1048. Event Type
  1049. ----------
  1050.  
  1051.    (not yet documented)
  1052.  
  1053. 
  1054. File: lispref.info,  Node: Process Type,  Next: Stream Type,  Prev: Event Type,  Up: Editing Types
  1055.  
  1056. Process Type
  1057. ------------
  1058.  
  1059.    The word "process" usually means a running program.  XEmacs itself
  1060. runs in a process of this sort.  However, in XEmacs Lisp, a process is a
  1061. Lisp object that designates a subprocess created by the XEmacs process.
  1062. Programs such as shells, GDB, ftp, and compilers, running in
  1063. subprocesses of XEmacs, extend the capabilities of XEmacs.
  1064.  
  1065.    An Emacs subprocess takes textual input from Emacs and returns
  1066. textual output to Emacs for further manipulation.  Emacs can also send
  1067. signals to the subprocess.
  1068.  
  1069.    Process objects have no read syntax.  They print in hash notation,
  1070. giving the name of the process, its associated process ID, and the
  1071. current state of the process:
  1072.  
  1073.      (process-list)
  1074.           => (#<process "shell" pid 2909 state:run>)
  1075.  
  1076.    *Note Processes::, for information about functions that create,
  1077. delete, return information about, send input or signals to, and receive
  1078. output from processes.
  1079.  
  1080. 
  1081. File: lispref.info,  Node: Stream Type,  Next: Keymap Type,  Prev: Process Type,  Up: Editing Types
  1082.  
  1083. Stream Type
  1084. -----------
  1085.  
  1086.    A "stream" is an object that can be used as a source or sink for
  1087. characters--either to supply characters for input or to accept them as
  1088. output.  Many different types can be used this way: markers, buffers,
  1089. strings, and functions.  Most often, input streams (character sources)
  1090. obtain characters from the keyboard, a buffer, or a file, and output
  1091. streams (character sinks) send characters to a buffer, such as a
  1092. `*Help*' buffer, or to the echo area.
  1093.  
  1094.    The object `nil', in addition to its other meanings, may be used as
  1095. a stream.  It stands for the value of the variable `standard-input' or
  1096. `standard-output'.  Also, the object `t' as a stream specifies input
  1097. using the minibuffer (*note Minibuffers::.) or output in the echo area
  1098. (*note The Echo Area::.).
  1099.  
  1100.    Streams have no special printed representation or read syntax, and
  1101. print as whatever primitive type they are.
  1102.  
  1103.    *Note Read and Print::, for a description of functions related to
  1104. streams, including parsing and printing functions.
  1105.  
  1106. 
  1107. File: lispref.info,  Node: Keymap Type,  Next: Syntax Table Type,  Prev: Stream Type,  Up: Editing Types
  1108.  
  1109. Keymap Type
  1110. -----------
  1111.  
  1112.    A "keymap" maps keys typed by the user to commands.  This mapping
  1113. controls how the user's command input is executed.
  1114.  
  1115.    NOTE: In XEmacs, a keymap is a separate primitive type.  In FSF GNU
  1116. Emacs, a keymap is actually a list whose CAR is the symbol `keymap'.
  1117.  
  1118.    *Note Keymaps::, for information about creating keymaps, handling
  1119. prefix keys, local as well as global keymaps, and changing key bindings.
  1120.  
  1121. 
  1122. File: lispref.info,  Node: Syntax Table Type,  Next: Display Table Type,  Prev: Keymap Type,  Up: Editing Types
  1123.  
  1124. Syntax Table Type
  1125. -----------------
  1126.  
  1127.    Under XEmacs 20, a "syntax table" is a particular type of char
  1128. table.  Under XEmacs 19, a syntax table a vector of 256 integers.  In
  1129. both cases, each element defines how one character is interpreted when
  1130. it appears in a buffer.  For example, in C mode (*note Major Modes::.),
  1131. the `+' character is punctuation, but in Lisp mode it is a valid
  1132. character in a symbol.  These modes specify different interpretations by
  1133. changing the syntax table entry for `+'.
  1134.  
  1135.    Syntax tables are used only for scanning text in buffers, not for
  1136. reading Lisp expressions.  The table the Lisp interpreter uses to read
  1137. expressions is built into the XEmacs source code and cannot be changed;
  1138. thus, to change the list delimiters to be `{' and `}' instead of `('
  1139. and `)' would be impossible.
  1140.  
  1141.    *Note Syntax Tables::, for details about syntax classes and how to
  1142. make and modify syntax tables.
  1143.  
  1144. 
  1145. File: lispref.info,  Node: Display Table Type,  Next: Database Type,  Prev: Syntax Table Type,  Up: Editing Types
  1146.  
  1147. Display Table Type
  1148. ------------------
  1149.  
  1150.    A "display table" specifies how to display each character code.
  1151. Each buffer and each window can have its own display table.  A display
  1152. table is actually a vector of length 256, although in XEmacs 20 this may
  1153. change to be a particular type of char table.  *Note Display Tables::.
  1154.  
  1155. 
  1156. File: lispref.info,  Node: Database Type,  Next: Charset Type,  Prev: Display Table Type,  Up: Editing Types
  1157.  
  1158. Database Type
  1159. -------------
  1160.  
  1161.    (not yet documented)
  1162.  
  1163. 
  1164. File: lispref.info,  Node: Charset Type,  Next: Coding System Type,  Prev: Database Type,  Up: Editing Types
  1165.  
  1166. Charset Type
  1167. ------------
  1168.  
  1169.    (not yet documented)
  1170.  
  1171. 
  1172. File: lispref.info,  Node: Coding System Type,  Next: ToolTalk Message Type,  Prev: Charset Type,  Up: Editing Types
  1173.  
  1174. Coding System Type
  1175. ------------------
  1176.  
  1177.    (not yet documented)
  1178.  
  1179. 
  1180. File: lispref.info,  Node: ToolTalk Message Type,  Next: ToolTalk Pattern Type,  Prev: Coding System Type,  Up: Editing Types
  1181.  
  1182. ToolTalk Message Type
  1183. ---------------------
  1184.  
  1185.    (not yet documented)
  1186.  
  1187. 
  1188. File: lispref.info,  Node: ToolTalk Pattern Type,  Prev: ToolTalk Message Type,  Up: Editing Types
  1189.  
  1190. ToolTalk Pattern Type
  1191. ---------------------
  1192.  
  1193.    (not yet documented)
  1194.  
  1195. 
  1196. File: lispref.info,  Node: Window-System Types,  Next: Type Predicates,  Prev: Editing Types,  Up: Lisp Data Types
  1197.  
  1198. Window-System Types
  1199. ===================
  1200.  
  1201.    XEmacs also has some types that represent objects such as faces
  1202. (collections of display characters), fonts, and pixmaps that are
  1203. commonly found in windowing systems.
  1204.  
  1205. * Menu:
  1206.  
  1207. * Face Type::           A collection of display characteristics.
  1208. * Glyph Type::          An image appearing in a buffer or elsewhere.
  1209. * Specifier Type::      A way of controlling display characteristics on
  1210.                           a per-buffer, -frame, -window, or -device level.
  1211. * Font Instance Type::  The way a font appears on a particular device.
  1212. * Color Instance Type:: The way a color appears on a particular device.
  1213. * Image Instance Type:: The way an image appears on a particular device.
  1214. * Toolbar Button Type:: An object representing a button in a toolbar.
  1215. * Subwindow Type::      An externally-controlled window-system window
  1216.                           appearing in a buffer.
  1217. * X Resource Type::     A miscellaneous X resource, if Epoch support was
  1218.                           compiled into XEmacs.
  1219.  
  1220. 
  1221. File: lispref.info,  Node: Face Type,  Next: Glyph Type,  Up: Window-System Types
  1222.  
  1223. Face Type
  1224. ---------
  1225.  
  1226.    (not yet documented)
  1227.  
  1228. 
  1229. File: lispref.info,  Node: Glyph Type,  Next: Specifier Type,  Prev: Face Type,  Up: Window-System Types
  1230.  
  1231. Glyph Type
  1232. ----------
  1233.  
  1234.    (not yet documented)
  1235.  
  1236. 
  1237. File: lispref.info,  Node: Specifier Type,  Next: Font Instance Type,  Prev: Glyph Type,  Up: Window-System Types
  1238.  
  1239. Specifier Type
  1240. --------------
  1241.  
  1242.    (not yet documented)
  1243.  
  1244.